# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
# Contributor: HuntXu <huntxu@live.cn>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=pngcrush
pkgver=1.8.13
pkgrel=3
pkgdesc='Tool for optimizing the compression of PNG files'
url='http://pmt.sourceforge.net/pngcrush'
arch=('loong64' 'x86_64')
license=('custom')
depends=('libpng')
source=(https://downloads.sourceforge.net/pmt/${pkgname}-${pkgver}-nolib.tar.xz{,.asc}
        LICENSE)
sha512sums=('c073d573e9b13b72fa39b178271ce65d1a19fef35943ef0a9e6121a5c66d9db212aaad38ab777c5b44e20a107eb677003acbdb4a354bcb2dc40f535a97d9df0e'
            'SKIP'
            'f18613b9da9b4f31a317411e726def5122246087ff57887fba6b46f0a7a7fae7109388ecb2ce049bbe992cc6ef0a3fbbe0f5c5bc816705efd7583836cbd4e69d')
validpgpkeys=('8048643BA2C840F4F92A195FF54984BFA16C640F') # Glenn Randers-Pehrson (pngcrush) <glennrp@users.sourceforge.net>

prepare() {
  cd ${pkgname}-${pkgver}-nolib
  sed -r 's| -g||g' -i Makefile
  sed -r 's|^(CFLAGS )=|\1+=|' -i Makefile
  sed -r 's|^(LDFLAGS )=|\1+=|' -i Makefile
}

build() {
  cd ${pkgname}-${pkgver}-nolib
  make
}

package() {
  cd ${pkgname}-${pkgver}-nolib
  make DESTDIR="${pkgdir}" install
  install -Dm 644 "${srcdir}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
